//
// Created by admin on 2024/5/15.
//
#include <iostream>

#include "../fifo.h"

uint8_t buffer[10];
Fifo_t  fifo = {
        .head = 0,
        .tail = 0,
        .buffer = buffer,
        .size = 10,
        .full = 0,
        .overflow = 0,
};

void func(uint8_t *data, uint32_t len) {

    uint8_t tmp;
    while (len --) {
        tmp = *(data++);
    }

    return;
}

int main() {

    uint8_t read_buff[10] = {'1', '2'};


    func(read_buff, 2);



    fifo_push(&fifo, (uint8_t *)"12\n", 3);
//    fifo_pull(&fifo, read_buff, 5);

    uint8_t push_buff[10] = {'?', 0xaa, '!', '~', 0xbb};
    fifo_push(&fifo, push_buff, 5);

    uint8_t key_buff[10];

    int len = 0;
    len = fifo_read_into_keyword(&fifo, '\n', key_buff, 10);
    len = fifo_read_head_to_tail(&fifo, 0xaa, 0xbb, key_buff, 10);
    std::cout << "end" << std::endl;


}